﻿@using Abc.Core;
@using Abc.Core.Entities;
@using Abc.Application;
@using Abc.Core.Enums;
@model Abc.Application.HtAdminServices.HtEmailSendRecordOut;


@{
    ViewData["Title"] = "邮件发送记录";
}



<section class="panel panel-padding">
    <div class="layui-tab layui-tab-brief" lay-filter="TabBrief_EmailSendRecord">

        <form class="layui-form" action="" id="from_EmailSendRecord">
            <input type="hidden" asp-for="Id" />
            <input type="hidden" asp-for="SourceDataId">
            <table class="layui-table">
                <tbody>
                    <tr>
                        <td width="200px;">邮件模板类型</td>
                        <td>
                            <select lay-filter="TemplateType" asp-for="TemplateType" asp-items="Html.GetEnumSelectList<EmailSendTemplateType>()"></select>
                            <input asp-for="TemplateType" lay-verify="TemplateType" autocomplete="off" placeholder="请输入邮件模板类型" class="layui-input">
                        </td>

                        <td width="200px;">来源数据表</td>
                        <td>

                            <input asp-for="SourceDataTable" lay-verify="SourceDataTable" autocomplete="off" placeholder="请输入来源数据表" class="layui-input">
                        </td>
                    </tr>
                    <tr>
                        <td width="200px;">主题</td>
                        <td>

                            <input asp-for="Subject" lay-verify="Subject" autocomplete="off" placeholder="请输入主题" class="layui-input">
                        </td>
                    </tr>

                    <tr>
                        <td width="200px;">邮件发送名称</td>
                        <td>

                            <input asp-for="SenderName" lay-verify="SenderName" autocomplete="off" placeholder="请输入邮件发送名称" class="layui-input">
                        </td>

                        <td width="200px;">邮件发送账号</td>
                        <td>

                            <input asp-for="SenderEmail" lay-verify="SenderEmail" autocomplete="off" placeholder="请输入邮件发送账号" class="layui-input">
                        </td>
                    </tr>
                    <tr>
                        <td width="200px;">收件人</td>
                        <td>

                            <input asp-for="ReceiveName" lay-verify="ReceiveName" autocomplete="off" placeholder="请输入收件人" class="layui-input">
                        </td>

                        <td width="200px;">收件邮箱</td>
                        <td>

                            <input asp-for="ReceiveEmail" lay-verify="ReceiveEmail" autocomplete="off" placeholder="请输入收件邮箱" class="layui-input">
                        </td>
                    </tr>
                    <tr>
                        <td width="200px;">邮件发送状态</td>
                        <td>
                            <select lay-filter="State" asp-for="State" asp-items="Html.GetEnumSelectList<EmailSendState>()"></select>
                        </td>
                    </tr>
                    <tr>
                        <td width="200px;">内容</td>
                        <td colspan="3">

                            <textarea class="layui-textarea" asp-for="Content" lay-verify="required|content"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td width="200px;">发送结果</td>
                        <td colspan="3">
                            <textarea asp-for="SendResult" placeholder="请输入内容" autocomplete="off" lay-verify="SendResult" class="layui-textarea"></textarea>
                        </td>
                    </tr>

                    <tr>
                        <td width="200px;">发送次数</td>
                        <td>

                            <input asp-for="SendNum" lay-verify="SendNum" autocomplete="off" placeholder="请输入发送次数" class="layui-input">
                        </td>

                        <td width="200px;">最大发送次数</td>
                        <td>

                            <input asp-for="SendMaxNum" lay-verify="SendMaxNum" autocomplete="off" placeholder="请输入最大发送次数" class="layui-input">
                        </td>
                    </tr>
                    <tr>
                        <td width="200px;">是否验证码</td>
                        <td>

                            <input type="checkbox" asp-for="IsVerCode" lay-skin="switch" title="开|关">
                        </td>

                        <td width="200px;">验证码</td>
                        <td>

                            <input asp-for="VerCode" lay-verify="VerCode" autocomplete="off" placeholder="请输入验证码" class="layui-input">
                        </td>
                    </tr>
                    <tr>
                        <td width="200px;">是否使用</td>
                        <td>

                            <input type="checkbox" asp-for="IsUse" lay-skin="switch" title="开|关">
                        </td>

                        <td width="200px;">过期时间</td>
                        <td>

                            <input type="text" class="layui-input" asp-for="ExpireTime" lay-verify="required|expireTime" placeholder="yyyy-MM-dd HH:mm:ss">
                        </td>
                    </tr>

                    @*
                    <textarea placeholder="请输入内容" class="layui-textarea"></textarea>
                    <input type="radio" name="sex" value="男" title="男" checked="">
                    <input type="radio" name="sex" value="女" title="女">
                    <input type="radio" name="sex" value="禁" title="禁用" disabled="">
                    *@
                    <tr>
                        <td></td>
                        <td>
                            <div class="layui-btn submitbtn" lay-submit lay-filter="submit">立即提交</div>
                            <div class="layui-btn layui-btn-danger closewindow">关闭窗口</div>
                            <div class="layui-btn layui-btn-danger refreshwindow">重新加载</div>
                        </td>
                    </tr>

                </tbody>
            </table>



        </form>
    </div>
</section>


@section Scripts{
    <script>
        layui.define(['element', 'jquery', 'form','tinymce'], function () {
            let $ = layui.jquery;
            let form = layui.form;
            let element = layui.element;
            var tinymce = layui.tinymce;
            abc.infoInit();

            var content = abc.tinymceInit({ elem: 'Content', url: '@(Url.Action("FileUpload"))' });
            //提交
            form.on('submit(submit)', function (obj) {
                //obj.field.IsEnable=$('#IsEnable').is(':checked');
                //obj.field.Remark = Remark.getContent();
                obj.field.Content = content.GetContent();
                abc.post({
                    url: '@(Url.Action("Edit", new { area = "HtAdmin" }))', data: obj.field
                    //,submitbtn:'submitbtn' //提交的按钮
                    //,isAutoEnableBtn:false //不自动启用按钮
                    //,IsSuccessCloseWindow:false //不关闭
                });

                return false;
            });


        });
    </script>
}

